package com.youlu.campus.service.attendance;

import com.youlu.campus.entity.UserDayDailyAttendanceInfo;
import com.youlu.campus.entity.UserPO;
import com.youlu.campus.entity.VO.req.DailyAttendanceQueryVO;
import com.youlu.campus.entity.VO.res.DailyAttendanceCalendarDetailRes;
import com.youlu.campus.entity.VO.res.DailyAttendanceCalendarRes;
import com.youlu.campus.entity.VO.res.DailyAttendanceInviteRes;
import com.youlu.campus.entity.domain.UserAttendanceSummary;
import com.youlu.campus.entity.enums.TaskBizType;

import java.util.Date;
import java.util.List;

/**
 * 打卡相关Service
 */
public interface DailyAttendanceService {
    /**
     * 获取打卡详情
     *
     * @param userId
     * @param activityId
     * @return
     */
    UserAttendanceSummary getDailyAttendanceDetail(final String userId, String activityId);

    /**
     * 用户参加打卡
     *
     * @param activityId
     * @param userPo
     * @return
     */
    boolean joinDailyAttendance(String activityId, UserPO userPo);

    /**
     * 打卡
     *
     * @param req
     * @return
     */
    boolean signUpDailyAttendance(DailyAttendanceQueryVO req);

    /**
     * 更新QQ运动步数
     *
     * @param userId
     * @param activityId
     * @param taskId
     * @param taskBizType
     * @param date
     * @return
     */

    void updateQQmovement(String id, String userId, String activityId, String taskId, TaskBizType taskBizType, Date date);

    /**
     * 获取用户每日打卡集合
     *
     * @param userId
     * @param activityId
     * @param taskId
     * @param startTime
     * @param endTime
     * @return
     */
    List<UserDayDailyAttendanceInfo> findUserDayDailyAttendanceInfo(String userId, String activityId, String taskId, Date startTime, Date endTime);

    /**
     * 获取打卡日历
     *
     * @param startTime
     * @param endTime
     * @param activityId
     * @param taskId
     * @param userId
     * @return
     */
    DailyAttendanceCalendarRes getDailyAttendanceCalendar(Date startTime, Date endTime, String activityId, String taskId, String userId);

    /**
     * 获取打卡日历详情
     *
     * @param userId
     * @param activityId
     * @param taskId
     * @param currentTime
     * @return
     */
    DailyAttendanceCalendarDetailRes getDailyAttendanceCalendarDetails(String userId, String activityId, String taskId, Date currentTime);

    /**
     * 观看广告补卡,返回补卡ID，回调后更新补卡状态
     *
     * @param userId
     * @param activityId
     * @param taskId
     * @param adsInfoId
     * @param date
     * @return
     */
    String reissueAd(String userId, String activityId, String taskId, String adsInfoId, Date date);

    /**
     * 观看广告补卡回调
     *
     * @param id
     * @return
     */
    boolean reissueAdCallBack(String id);

    /**
     * 打卡邀请详情
     *
     * @param userId
     * @param activityId
     * @param taskId
     * @return
     */
    DailyAttendanceInviteRes dailyAttendanceInviteDetail(String userId, String activityId,
                                                         String taskId);

    /**
     * 用户打卡
     *
     * @param userId
     * @param activityId
     * @param date
     */
    void attendance(String userId, String activityId, Date date);

    /**
     * 用户是否打卡
     *
     * @param userId
     * @param activityId
     * @param date
     */
    boolean isAttendance(String userId, String activityId, Date date);

    /**
     * 用户是否首次打卡
     *
     * @param userId
     * @param activityId
     * @return
     */
    boolean isFirst(String userId, String activityId);


    /**
     * 用户设置首次打卡
     *
     * @param userId
     * @param activityId
     * @return
     */
    boolean doFirstAttendance(String userId, String activityId, Date date);


}
